<!doctype html>
<html lang="en">

<head>
    <!-- meta data -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!--font-family-->
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900&amp;subset=devanagari,latin-ext"
          rel="stylesheet">

    <!-- title of site -->
    <title>立即注册</title>

    <!-- For favicon png -->
    <link rel="shortcut icon" type="image/icon" href="/reception/assets/logo/favicon.png"/>

    <!--font-awesome.min.css-->
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">

    <!--animate.css-->
    <link rel="stylesheet" href="/reception/assets/css/animate.css">

    <!--bootstrap.min.css-->
    <link rel="stylesheet" href="/reception/assets/css/bootstrap.min.css">

    <!-- bootsnav -->
    <link rel="stylesheet" href="/reception/assets/css/bootsnav.css">

    <!--style.css-->
    <link rel="stylesheet" href="/reception/assets/css/style.css">

    <!--responsive.css-->
    <link rel="stylesheet" href="/reception/assets/css/responsive.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<!--[if lte IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade
    your browser</a> to improve your experience and security.</p>
<![endif]-->

<!-- signin end -->
<section class="signin signup">
    <div class="container" id="user_form">

        <div class="sign-content">
            <h2>注册为商家</h2>

            <div class="signin-form">
                <div class=" ">
                    <div class=" ">
                        <form>
                            <div class="form-group">
                                <label for="userName">用户名</label>
                                <input v-model:value="user.userName" type="text" class="form-control" id="userName"
                                       placeholder="Enter your User Name">
                            </div><!--/.form-group -->
                            <div class="form-group">
                                <label for="password">密码</label>
                                <input v-model:value="user.password" type="password" class="form-control" id="password"
                                       placeholder="Enter your password">
                            </div><!--/.form-group -->
                            <div class="form-group">
                                <label for="tel">联系方式</label>
                                <input v-model:value="user.userPhone" type="tel" class="form-control" id="tel"
                                       placeholder="Enter your email Telephone">
                            </div><!--/.form-group -->
                            <div class="form-group">
                                <label for="email">邮箱</label>
                                <input v-model:value="user.userEmail" type="email" class="form-control" id="email"
                                       placeholder="Enter your Email">
                            </div><!--/.form-group -->
                        </form><!--/form -->
                    </div><!--/.col -->
                </div><!--/.row -->

            </div><!--/.signin-form -->

            <div class="signin-footer">
                <button type="button" @click="supplierRegister()" class="btn signin_btn signin_btn_two">
                    点击注册
                </button>
                <p>
                    &nbsp; 已经有帐号了 ?
                    <a href="/tourism/login"> &nbsp;&nbsp;&nbsp;点击登陆</a>
                </p>
            </div><!--/.signin-footer -->
        </div><!--/.sign-content -->
    </div><!--/.container -->

</section><!--/.signin -->

<!-- signin end -->

<!--footer copyright start -->
<footer class="footer-copyright">
    <div>
        <i class="fa fa-angle-double-up return-to-top" id="scroll-top" data-toggle="tooltip" data-placement="top"
           title="" data-original-title="Back to Top" aria-hidden="true"></i>
    </div><!--/.scroll-Top-->

</footer><!--/.hm-footer-copyright-->
<!--footer copyright  end -->


<!-- Include all js compiled plugins (below), or include individual files as needed -->

<script src="/reception/assets/js/jquery.js"></script>

<!--modernizr.min.js-->

<script src="https://cdn.bootcdn.net/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<!--bootstrap.min.js-->
<script src="/reception/assets/js/bootstrap.min.js"></script>

<!-- bootsnav js -->
<script src="/reception/assets/js/bootsnav.js"></script>

<!-- jquery.sticky.js -->
<script src="/reception/assets/js/jquery.sticky.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>

<!--Custom JS-->
<script src="/reception/assets/js/custom.js"></script>

<!-- Vue -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script type="text/javascript">
    var userVue = new Vue({
        el: "#user_form",
        data: {
            user: {
                userName: "",
                password: "",
                userPhone: "",
                userEmail: "",
            }
        },
        methods: {
            supplierRegister: function () {
                var user = this.user
                $.ajax({
                    url: "/api/supplierRegister",
                    type: "POST",
                    contentType: "application/json",
                    dataType: "json",
                    data: JSON.stringify(user),
                    success: function (rs) {
                        if (confirm("注册成功，是否前往登陆页面？")) {
                            location.href = "/tourism/login"
                        }
                    }
                })
            }
        },
    })
</script>
</body>

</html>